home *** CD-ROM | disk | FTP | other *** search
/ My Neighborhood / My Neighborhood.iso / mac / MacFiles / FarmCat.Dxr / 00002.ls < prev    next >
Encoding:
Text File  |  1997-11-18  |  2.1 KB  |  63 lines

  1. on exitFrame
  2.   global snap, tempH, tempV, snapH, snapV, lastClickOn
  3.   if (the locH of sprite lastClickOn > (snapH - 25)) and (the locH of sprite lastClickOn < (snapH + 25)) and ((the locV of sprite lastClickOn > (snapV - 25)) and (the locV of sprite lastClickOn < (snapV + 25))) then
  4.     if snap = 0 then
  5.       set tempH to the mouseH
  6.       set tempV to the mouseV
  7.       puppetSound("synthdrip.s")
  8.     end if
  9.     set snap to 1
  10.     if (the mouseH > (tempH - 25)) and (the mouseH < (tempH + 25)) and ((the mouseV > (tempV - 25)) and (the mouseV < (tempV + 25))) then
  11.       set the locH of sprite lastClickOn to snapH
  12.       set the locV of sprite lastClickOn to snapV
  13.     else
  14.       set the locH of sprite lastClickOn to the mouseH
  15.       set the locV of sprite lastClickOn to the mouseV
  16.     end if
  17.     updateStage()
  18.   else
  19.     set snap to 0
  20.     set the locH of sprite lastClickOn to the mouseH
  21.     set the locV of sprite lastClickOn to the mouseV
  22.   end if
  23.   updateStage()
  24.   go(the frame)
  25. end
  26.  
  27. on mouseUp
  28.   global follow, snap, lastClickOn, homeV, homeH, snapH, snapV
  29.   set follow to 0
  30.   if snap = 1 then
  31.     set the locH of sprite lastClickOn to snapH
  32.     set the locV of sprite lastClickOn to snapV
  33.     updateStage()
  34.     wait(20)
  35.     if the name of cast the castNum of sprite lastClickOn = "cat" then
  36.       puppetSound("toots.s")
  37.       updateStage()
  38.       wait(20)
  39.       go(the frame + 1)
  40.     else
  41.       set the visible of sprite (lastClickOn - 5) to 1
  42.       set the visible of sprite lastClickOn to 0
  43.       set the castNum of sprite lastClickOn to the castNum of sprite (lastClickOn - 5)
  44.       set the locH of sprite lastClickOn to homeH
  45.       set the locV of sprite lastClickOn to homeV
  46.       puppetSound("swiper.s")
  47.       updateStage()
  48.       wait(20)
  49.       go(the frame - 1)
  50.     end if
  51.   else
  52.     puppetSound("swipe.s")
  53.     set the visible of sprite (lastClickOn - 5) to 1
  54.     set the visible of sprite lastClickOn to 0
  55.     set the castNum of sprite lastClickOn to the castNum of sprite (lastClickOn - 5)
  56.     set the locH of sprite lastClickOn to homeH
  57.     set the locV of sprite lastClickOn to homeV
  58.     updateStage()
  59.     wait(20)
  60.     go(the frame - 1)
  61.   end if
  62. end
  63.